<?php
/***************************************
** Filename.......: example.php
** Project........: Mime Decoder
** Last Modified..: 26 September 2001
***************************************/

/***************************************
** This script shows how to use the mime
** decoding class. All it does is take
** the input, decode it, and show it on
** screen.
***************************************/

	include('./mimeDecode.php');

	$filename = './test2.txt';
	$message  = fread(fopen($filename, 'r'), filesize($filename));

	header('Content-Type: text/plain');
	header('Content-Disposition: inline; filename="stuff.txt"');

	$params = array(
					'input'          => $message,
					'crlf'           => "\r\n",
					'include_bodies' => TRUE,
					'decode_headers' => TRUE,
					'decode_bodies'  => TRUE
					);

	print_r(Mail_mimeDecode::decode($params));
	$mail = Mail_mimeDecode::decode($params);
//	echo "............................................................................<br>";
//	$parts=$mail->parts[0];
//	$parts=$parts->parts[0];
//	$parts=$parts->parts[0];
	print_r($mail);
?>